#include "UnitTest++/UnitTest++.h"

#include "ring.h"

TEST(Ring)
{
    Ring ring;
    ring.lenght = 4;
    ring.offset = 8;

    CHECK(ring.next(0) == 8 + 1);
    CHECK(ring.next(3) == 8 + 0);
    CHECK(ring.previous(0) == 8 + 3);
    CHECK(ring.previous(3) == 8 + 2);

    CHECK(ring.next(0) == ring[1]);
    CHECK(ring.next(3) == ring[0]);
    CHECK(ring.previous(0) == ring[3]);
    CHECK(ring.previous(3) == ring[2]);
}
